YES 0.745 H-Termination proof of /home/matraf/haskell/eval_FullyBlown_Fast/FiniteMap.hs
H-Termination of the given Haskell-Program with start terms could successfully be proven:



HASKELL
  ↳ LR

mainModule FiniteMap
  ((keysFM :: FiniteMap a b  ->  [a]) :: FiniteMap a b  ->  [a])

module FiniteMap where
  import qualified Maybe
import qualified Prelude

  data FiniteMap b a = EmptyFM  | Branch b a Int (FiniteMap b a) (FiniteMap b a


  foldFM :: (b  ->  c  ->  a  ->  a ->  a  ->  FiniteMap b c  ->  a
foldFM k z EmptyFM z
foldFM k z (Branch key elt _ fm_l fm_rfoldFM k (k key elt (foldFM k z fm_r)) fm_l

  keysFM :: FiniteMap a b  ->  [a]
keysFM fm foldFM (\key elt rest ->key : rest) [] fm


module Maybe where
  import qualified FiniteMap
import qualified Prelude



Lambda Reductions:
The following Lambda expression
\keyeltrestkey : rest

is transformed to
keysFM0 key elt rest = key : rest



↳ HASKELL
  ↳ LR
HASKELL
      ↳ BR

mainModule FiniteMap
  ((keysFM :: FiniteMap a b  ->  [a]) :: FiniteMap a b  ->  [a])

module FiniteMap where
  import qualified Maybe
import qualified Prelude

  data FiniteMap a b = EmptyFM  | Branch a b Int (FiniteMap a b) (FiniteMap a b


  foldFM :: (b  ->  a  ->  c  ->  c ->  c  ->  FiniteMap b a  ->  c
foldFM k z EmptyFM z
foldFM k z (Branch key elt _ fm_l fm_rfoldFM k (k key elt (foldFM k z fm_r)) fm_l

  keysFM :: FiniteMap b a  ->  [b]
keysFM fm foldFM keysFM0 [] fm

  
keysFM0 key elt rest key : rest


module Maybe where
  import qualified FiniteMap
import qualified Prelude



Replaced joker patterns by fresh variables and removed binding patterns.

↳ HASKELL
  ↳ LR
    ↳ HASKELL
      ↳ BR
HASKELL
          ↳ COR

mainModule FiniteMap
  ((keysFM :: FiniteMap b a  ->  [b]) :: FiniteMap b a  ->  [b])

module FiniteMap where
  import qualified Maybe
import qualified Prelude

  data FiniteMap a b = EmptyFM  | Branch a b Int (FiniteMap a b) (FiniteMap a b


  foldFM :: (a  ->  c  ->  b  ->  b ->  b  ->  FiniteMap a c  ->  b
foldFM k z EmptyFM z
foldFM k z (Branch key elt vw fm_l fm_rfoldFM k (k key elt (foldFM k z fm_r)) fm_l

  keysFM :: FiniteMap b a  ->  [b]
keysFM fm foldFM keysFM0 [] fm

  
keysFM0 key elt rest key : rest


module Maybe where
  import qualified FiniteMap
import qualified Prelude



Cond Reductions:
The following Function with conditions
undefined 
 | False
 = undefined

is transformed to
undefined  = undefined1

undefined0 True = undefined

undefined1  = undefined0 False



↳ HASKELL
  ↳ LR
    ↳ HASKELL
      ↳ BR
        ↳ HASKELL
          ↳ COR
HASKELL
              ↳ Narrow

mainModule FiniteMap
  (keysFM :: FiniteMap a b  ->  [a])

module FiniteMap where
  import qualified Maybe
import qualified Prelude

  data FiniteMap b a = EmptyFM  | Branch b a Int (FiniteMap b a) (FiniteMap b a


  foldFM :: (c  ->  a  ->  b  ->  b ->  b  ->  FiniteMap c a  ->  b
foldFM k z EmptyFM z
foldFM k z (Branch key elt vw fm_l fm_rfoldFM k (k key elt (foldFM k z fm_r)) fm_l

  keysFM :: FiniteMap b a  ->  [b]
keysFM fm foldFM keysFM0 [] fm

  
keysFM0 key elt rest key : rest


module Maybe where
  import qualified FiniteMap
import qualified Prelude



Haskell To QDPs


↳ HASKELL
  ↳ LR
    ↳ HASKELL
      ↳ BR
        ↳ HASKELL
          ↳ COR
            ↳ HASKELL
              ↳ Narrow
                ↳ AND
QDP
                    ↳ QDPSizeChangeProof
                  ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

new_foldFM(vz30, vz31, vz4, Branch(vz330, vz331, vz332, vz333, vz334), h, ba) → new_foldFM(vz330, vz331, new_foldFM0(vz30, vz31, vz4, vz334, h, ba), vz333, h, ba)
new_foldFM(vz30, vz31, vz4, Branch(vz330, vz331, vz332, vz333, vz334), h, ba) → new_foldFM(vz30, vz31, vz4, vz334, h, ba)

The TRS R consists of the following rules:

new_foldFM0(vz30, vz31, vz4, Branch(vz330, vz331, vz332, vz333, vz334), h, ba) → new_foldFM0(vz330, vz331, new_foldFM0(vz30, vz31, vz4, vz334, h, ba), vz333, h, ba)
new_foldFM0(vz30, vz31, vz4, EmptyFM, h, ba) → :(vz30, vz4)

The set Q consists of the following terms:

new_foldFM0(x0, x1, x2, EmptyFM, x3, x4)
new_foldFM0(x0, x1, x2, Branch(x3, x4, x5, x6, x7), x8, x9)

We have to consider all minimal (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ HASKELL
  ↳ LR
    ↳ HASKELL
      ↳ BR
        ↳ HASKELL
          ↳ COR
            ↳ HASKELL
              ↳ Narrow
                ↳ AND
                  ↳ QDP
QDP
                    ↳ QDPSizeChangeProof

Q DP problem:
The TRS P consists of the following rules:

new_foldFM1(Branch(vz30, vz31, vz32, vz33, vz34), h, ba) → new_foldFM1(vz34, h, ba)

R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs: